
package com.shop.cloud.mall.api.controller;

import com.shop.cloud.common.core.constant.CommonConstants;
import com.shop.cloud.common.core.util.R;
import com.shop.cloud.mall.api.service.GoodsCategoryService;
import com.shop.cloud.mall.common.entity.GoodsCategory;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品类目
 *
 * @author
 * @date 2019-08-12 11:46:28
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/goodscategory")
@Tag(description = "goodscategory", name = "商品类目API")
public class GoodsCategoryController {

    private final GoodsCategoryService goodsCategoryService;

    /**
    * 返回树形集合
    */
	@Operation(summary = "返回树形集合")
    @GetMapping("/tree")
    public R goodsCategoryTree(GoodsCategory goodsCategory) {
		goodsCategory.setEnable(CommonConstants.YES);
		return R.ok(goodsCategoryService.selectTree(goodsCategory));
    }

}
